<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>推荐职位 - 人才职业生涯规划平台</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        /* 基础样式 */
        body {
            background-color: #f5f7fa;
            color: #333;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
            padding: 0;
            font-size: 14px;
        }
        
        .app-container {
            max-width: 375px; /* 标准小程序尺寸 */
            margin: 0 auto;
            background-color: #f5f7fa;
            min-height: 100vh;
            padding-bottom: 20px;
        }
        
        /* 头部导航 */
        .page-header {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            background-color: #fff;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .back-button {
            border: none;
            background: none;
            font-size: 18px;
            color: #333;
            padding: 0;
            margin-right: 12px;
            display: flex;
            align-items: center;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        
        .page-title {
            font-size: 16px;
            font-weight: 600;
            flex: 1;
            text-align: center;
            margin: 0;
        }
        
        .filter-button {
            border: none;
            background: none;
            font-size: 20px;
            color: #333;
            padding: 0;
            display: flex;
            align-items: center;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        
        /* 搜索栏 */
        .search-bar {
            background-color: #f0f2f5;
            margin: 10px 16px;
            border-radius: 4px;
            padding: 8px 12px;
            display: flex;
            align-items: center;
        }
        
        .search-icon {
            color: #999;
            margin-right: 8px;
            font-size: 16px;
        }
        
        .search-input {
            border: none;
            background: transparent;
            flex: 1;
            font-size: 14px;
            color: #333;
            padding: 0;
        }
        
        .search-input::placeholder {
            color: #999;
        }
        
        /* 标签栏 */
        .tab-container {
            background-color: #fff;
            padding: 0 10px;
            overflow-x: auto;
            white-space: nowrap;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
            position: relative;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .tab-container::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Opera */
        }
        
        .tab-list {
            display: inline-flex;
            padding: 0;
            margin: 0;
            list-style: none;
        }
        
        .tab-item {
            padding: 12px 16px;
            font-size: 14px;
            color: #666;
            cursor: pointer;
            position: relative;
            -webkit-tap-highlight-color: transparent;
        }
        
        .tab-item.active {
            color: #4863dc;
            font-weight: 500;
        }
        
        .tab-item.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 3px;
            background-color: #4863dc;
            border-radius: 3px;
        }
        
        /* 职位卡片 */
        .job-card {
            background-color: #fff;
            margin: 10px 16px;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }
        
        .job-header {
            display: flex;
            margin-bottom: 10px;
        }
        
        .job-logo {
            width: 50px;
            height: 50px;
            border-radius: 4px;
            object-fit: contain;
            background-color: #f7f7f7;
            border: 1px solid #eee;
            margin-right: 12px;
        }
        
        .job-info {
            flex: 1;
        }
        
        .job-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin: 0 0 6px;
        }
        
        .job-company {
            font-size: 13px;
            color: #666;
            margin: 0 0 6px;
        }
        
        .job-salary {
            font-size: 14px;
            color: #ff6b6b;
            font-weight: 500;
            margin: 0;
        }
        
        .job-tags {
            display: flex;
            flex-wrap: wrap;
            margin: 10px 0;
            gap: 8px;
        }
        
        .job-tag {
            background-color: #f7f7f7;
            color: #666;
            padding: 4px 8px;
            border-radius: 2px;
            font-size: 12px;
        }
        
        .job-location {
            display: flex;
            align-items: center;
            font-size: 12px;
            color: #999;
        }
        
        .location-icon {
            margin-right: 4px;
            font-size: 14px;
        }
        
        /* 加载状态 */
        .loading-container {
            text-align: center;
            padding: 20px 0;
            color: #999;
            font-size: 13px;
        }
        
        /* 筛选滑动指示器 */
        .scroll-indicator {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 24px;
            background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
            pointer-events: none;
        }
    </style>
</head>
<body>
    <div class="app-container">
        <!-- 头部导航 -->
        <header class="page-header">
            <button class="back-button" onclick="history.back()">
                <i class="bi bi-chevron-left"></i>
            </button>
            <h1 class="page-title">推荐职位</h1>
            <button class="filter-button">
                <i class="bi bi-funnel"></i>
            </button>
        </header>
        
        <!-- 搜索栏 -->
        <div class="search-bar">
            <i class="bi bi-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索职位、公司、技能关键词">
        </div>
        
        <!-- 标签栏 -->
        <div class="tab-container">
            <ul class="tab-list">
                <li class="tab-item active">全部</li>
                <li class="tab-item">最新发布</li>
                <li class="tab-item">为您推荐</li>
                <li class="tab-item">热门职位</li>
                <li class="tab-item">技术</li>
                <li class="tab-item">产品</li>
                <li class="tab-item">设计</li>
                <li class="tab-item">运营</li>
                <li class="tab-item">市场</li>
            </ul>
            <div class="scroll-indicator"></div>
        </div>
        
        <!-- 职位列表 -->
        <div class="job-list">
            <!-- 职位卡片1 -->
            <div class="job-card" data-id="1001">
                <div class="job-header">
                    <img src="../img/company1.jpg" alt="公司Logo" class="job-logo">
                    <div class="job-info">
                        <h2 class="job-title">前端开发工程师</h2>
                        <p class="job-company">字节跳动</p>
                        <p class="job-salary">20k-30k · 14薪</p>
                    </div>
                </div>
                <div class="job-tags">
                    <span class="job-tag">React</span>
                    <span class="job-tag">Vue</span>
                    <span class="job-tag">3-5年</span>
                    <span class="job-tag">本科</span>
                </div>
                <div class="job-location">
                    <i class="bi bi-geo-alt location-icon"></i>
                    <span>互联网 · 北京</span>
                </div>
            </div>
            
            <!-- 职位卡片2 -->
            <div class="job-card" data-id="1002">
                <div class="job-header">
                    <img src="../img/company2.jpg" alt="公司Logo" class="job-logo">
                    <div class="job-info">
                        <h2 class="job-title">产品经理</h2>
                        <p class="job-company">腾讯</p>
                        <p class="job-salary">15k-25k · 13薪</p>
                    </div>
                </div>
                <div class="job-tags">
                    <span class="job-tag">产品设计</span>
                    <span class="job-tag">数据分析</span>
                    <span class="job-tag">1-3年</span>
                    <span class="job-tag">本科</span>
                </div>
                <div class="job-location">
                    <i class="bi bi-geo-alt location-icon"></i>
                    <span>互联网 · 深圳</span>
                </div>
            </div>
            
            <!-- 职位卡片3 -->
            <div class="job-card" data-id="1003">
                <div class="job-header">
                    <img src="../img/company3.jpg" alt="公司Logo" class="job-logo">
                    <div class="job-info">
                        <h2 class="job-title">后端开发工程师</h2>
                        <p class="job-company">阿里巴巴</p>
                        <p class="job-salary">25k-40k · 16薪</p>
                    </div>
                </div>
                <div class="job-tags">
                    <span class="job-tag">Java</span>
                    <span class="job-tag">微服务</span>
                    <span class="job-tag">5-7年</span>
                    <span class="job-tag">本科</span>
                </div>
                <div class="job-location">
                    <i class="bi bi-geo-alt location-icon"></i>
                    <span>互联网 · 杭州</span>
                </div>
            </div>
            
            <!-- 职位卡片4 -->
            <div class="job-card" data-id="1004">
                <div class="job-header">
                    <img src="../img/company4.jpg" alt="公司Logo" class="job-logo">
                    <div class="job-info">
                        <h2 class="job-title">数据分析师</h2>
                        <p class="job-company">百度</p>
                        <p class="job-salary">18k-30k · 14薪</p>
                    </div>
                </div>
                <div class="job-tags">
                    <span class="job-tag">数据分析</span>
                    <span class="job-tag">Python</span>
                    <span class="job-tag">2-4年</span>
                    <span class="job-tag">硕士</span>
                </div>
                <div class="job-location">
                    <i class="bi bi-geo-alt location-icon"></i>
                    <span>互联网 · 北京</span>
                </div>
            </div>
            
            <!-- 加载状态 -->
            <div class="loading-container">
                加载更多职位...
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 标签栏点击处理
            const tabItems = document.querySelectorAll('.tab-item');
            tabItems.forEach(item => {
                item.addEventListener('click', function() {
                    tabItems.forEach(tab => tab.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 模拟加载不同类型的职位
                    const tabName = this.textContent;
                    document.querySelector('.loading-container').textContent = `正在加载${tabName}职位...`;
                    
                    // 实际应用中这里会调用接口获取对应标签的数据
                });
            });
            
            // 职位卡片点击跳转
            const jobCards = document.querySelectorAll('.job-card');
            jobCards.forEach(card => {
                card.addEventListener('click', function() {
                    const jobId = this.getAttribute('data-id');
                    window.location.href = `internship-detail.html?id=${jobId}`;
                });
            });
            
            // 搜索框交互
            const searchInput = document.querySelector('.search-input');
            searchInput.addEventListener('focus', function() {
                this.parentNode.style.backgroundColor = '#e8eaf0';
            });
            
            searchInput.addEventListener('blur', function() {
                this.parentNode.style.backgroundColor = '#f0f2f5';
            });
            
            // 无限滚动加载
            window.addEventListener('scroll', function() {
                const scrollY = window.scrollY;
                const windowHeight = window.innerHeight;
                const documentHeight = document.documentElement.scrollHeight;
                
                // 当滚动到距离底部100px时触发加载
                if (scrollY + windowHeight >= documentHeight - 100) {
                    loadMoreJobs();
                }
            });
            
            // 模拟加载更多职位
            function loadMoreJobs() {
                const loading = document.querySelector('.loading-container');
                loading.textContent = '正在加载...';
                
                // 模拟网络请求延迟
                setTimeout(() => {
                    // 切换加载状态
                    loading.textContent = '加载更多职位...';
                }, 1500);
            }
        });
    </script>
</body>
</html> 